package com.example.springcloudwinter.mapper;


import com.example.springcloudwinter.po.BusinessPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.sql.SQLException;
import java.util.List;

@Mapper
public interface BusinessMapper {
    @Select("SELECT businessId,businessName,businessAddress,businessExplain,businessImg,orderTypeId,starPrice," +
            "deliveryPrice,remarks FROM business WHERE businessId=#{businessId}")
    BusinessPo getByBusinessId(@Param("businessId")int businessId);

    @Select("SELECT businessId,businessName,businessAddress,businessExplain,businessImg,orderTypeId,starPrice," +
            "deliveryPrice,remarks FROM business WHERE orderTypeId=#{orderTypeId}")
    List<BusinessPo> getListByCategory(@Param("orderTypeId")int orderTypeId);

    @Select("SELECT businessId,businessName,businessAddress,businessExplain,businessImg,orderTypeId,starPrice," +
            "deliveryPrice,remarks FROM business")
    List<BusinessPo> getAllList();

}
